---
title: "SQL-021: Retrieve legal secretary employee ID by attorney"
summary: Retrieve an attorney's assigned legal secretary employee ID for the summary/other-parties view.
status: draft
owner: SAIF Documentation Pipeline
last_reviewed: 2026-08-21
library: SAIF.Application.Claim.Legal
reference_type: embedded
---

# SQL-021 Retrieve legal secretary employee ID by attorney

Scalar lookup of `attorney_profile.secretary_emplid` for a given attorney employee ID, used by `clsSummaryManager.GetLegalSecretaryID` (called from `LegalSecretary`) to resolve the assigned legal secretary for the summary/other-parties view.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-021 |
| **Operation type** | Read |
| **Execution method** | Inline SQL, scalar query (`SqlHelper.ScalarQuery(Of String)`) |
| **Database** | Oracle |
| **Command type** | Text |
| **Business object** | N/A (Application layer) |
| **Criteria property** | N/A (Application layer) |
| **Lifecycle method** | N/A (Application layer) |
| **Application class** | `clsSummaryManager` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:ID` | Input | String | 11 | Attorney's `profile_emplid`, bound via `AddParm("ID", inAssignedAttorneyID, 11)`, used to look up the assigned secretary's employee ID from `attorney_profile`. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [ATTORNEY_PROFILE](../database-tables.md#attorney_profile) | SELECT | `PROFILE_EMPLID`, `SECRETARY_EMPLID` |

## Sample SQL

```sql
Select secretary_emplid
from attorney_profile
where profile_emplid = :ID
```

## Sources
- `SAIF.Application.Claim.Legal\LegalNet\clsSummaryManager.vb`
